//
//  SMyTravelCollectionViewCell.m
//  News
//
//  Created by dlios on 15-5-15.
//  Copyright (c) 2015年 PEAK. All rights reserved.
//

#import "SMyTravelCollectionViewCell.h"

@interface SMyTravelCollectionViewCell ()<UITableViewDataSource, UITableViewDelegate>

@property(nonatomic,retain)UITableViewCell *cell;

@end
@implementation SMyTravelCollectionViewCell
- (void)dealloc
{
    [_table release];
    [super dealloc];
}

// 重写初始化

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.table = [[UITableView  alloc] init];
        _table.delegate = self;
        _table.dataSource =self;
        
        [self.contentView addSubview:_table];
        [_table release];
    }
    return self;
}
// 设置colltentViewCell位置信息

-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
   
    
    _table.frame = CGRectMake(0, 0, self.contentView.bounds.size.width, self.contentView.bounds.size.height );
    
    UIImageView *imgHeader = [[UIImageView alloc] init];
    imgHeader.frame = CGRectMake(0, 0, 375, 150);
    imgHeader.image = [UIImage imageNamed:@"page_bg_35"];
    imgHeader.backgroundColor = [UIColor redColor];
    _table.tableHeaderView = imgHeader;
    
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    
    return 100;
}


//重写model
-(void)setModel:(STravelObject *)model
{
    if (_model !=model) {
        [_model release];
        _model = [model retain];
    }

}
@end
